package com.lehecai.core.search.api.impl;

import net.sf.json.JSON;
import net.sf.json.JSONObject;

import com.lehecai.core.search.api.SearchApiConstant;
import com.lehecai.core.search.api.SearchApiRequestFilter;

/**
 * Delete操作时的Body封装
 * User: sunshow
 * Date: 13-4-1
 * Time: 上午8:53
 */
public class DeleteSearchApiRequestBody extends AbstractSearchApiRequestBody {

    private SearchApiRequestFilter filter;

    @Override
    public JSON toJSON() {
        JSONObject jsonObject = new JSONObject();
        if (this.filter != null) {
            jsonObject.put(SearchApiConstant.API_PARAMETER_FILTER, this.filter.toJSON());
        }
        return jsonObject;
    }

    public SearchApiRequestFilter getFilter() {
        return filter;
    }

    public void setFilter(SearchApiRequestFilter filter) {
        this.filter = filter;
    }

}
